home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / OpenGL / OPENGL2.EXE / _SETUP.1 / cull_vertex.spec < prev    next >
Encoding:
Text File  |  1997-10-31  |  5.5 KB  |  166 lines

  1. XXX - Not complete yet!!!
  2.  
  3. Name
  4.  
  5.     EXT_cull_vertex
  6.  
  7. Name Strings
  8.  
  9.     GL_EXT_cull_vertex
  10.  
  11. Version
  12.  
  13.     $Date: 1997/07/22 21:00:40 $ $Revision: 1.1 $
  14.  
  15. Number
  16.  
  17.     98
  18.  
  19. Dependencies
  20.  
  21.     None
  22.  
  23. Overview
  24.  
  25.     This extension introduces a method for culling vertexes in object
  26.     space based on the value of the dot product between the normal at
  27.     the vertex and a culling eye direction.
  28.  
  29.     Culling a polygon by examining its vertexes in object space can be
  30.     more efficient than screen space polygon culling since the transformation
  31.     to screen space (which may include a division by w) can be avoided for
  32.     culled vertexes.  Also, vertex culling can be computed before vertexes
  33.     are assembled into primitives.  This is a useful property when drawing
  34.     meshes with shared vertexes, since a vertex can be culled once, and the
  35.     resulting state can be used for all primitives which share the vertex.
  36.  
  37. Issues
  38.  
  39.     * Should FrontFace affect the comparison of the dot product?
  40.       It may be useful.  For non-local eye positions it is easy for
  41.       the application to flip the eye direction in order to cull
  42.       either front or back faces.  This doesn't work as well for
  43.       local eye positions.  We'll defer this for now; it is easy
  44.       to add as an extension later.
  45.  
  46.     * Could determine the eye position/direction in object space
  47.       by transforming the vector (0, 0, 1, 0) by the inverse of
  48.       the composite of the modelview and projection transformations.
  49.       Seems better to have the application provide the eye position/direction
  50.       than to have OpenGL pick one arbitrarily.
  51.  
  52. New Procedures and Functions
  53.  
  54.     void CullParameterfvEXT (enum pname, float *params)
  55.     void CullParameterdvEXT (enum pname, double *params)
  56.  
  57. New Tokens
  58.  
  59.    Accepted by the <cap> parameter of Enable, Disable, and
  60.    IsEnabled, and by the <pname> parameter of GetBooleanv,
  61.    GetIntegerv, GetFloatv, and GetDoublev:
  62.  
  63.        CULL_VERTEX_EXT
  64.  
  65.    Accepted by the <pname> parameter of CullParameterfvEXT,
  66.    CullParameterdvEXT, GetBooleanv, GetIntegerv, GetFloatv, and
  67.    GetDoublev:
  68.  
  69.        CULL_VERTEX_EYE_POSITION_EXT
  70.        CULL_VERTEX_OBJECT_POSITION_EXT
  71.  
  72. Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
  73.  
  74.    Before the discussion of Clipping, add a description of 
  75.    vertex culling.
  76.  
  77.    Vertex Culling
  78.  
  79.    Vertex culling may be used to eliminate vertexes which are
  80.    part of back facing primitives.  Vertex culling is enabled
  81.    or disabled by using the Enable or Disable commands with
  82.    the symbolic constant CULL_VERTEX_EXT.
  83.  
  84.    When vertex culling is enabled, vertexes are classified as
  85.    front or back facing according to the sign of the dot
  86.    product between the normal at the vertex and an eye direction
  87.    vector from the vertex toward the eye position.  When
  88.    (normal dot eye_direction) <= 0 the vertex is classified as
  89.    back facing.  When (normal dot eye_direction) > 0 the vertex
  90.    is classified as front facing.  Vertexes are culled when the
  91.    face orientation determined by the dot product is the same
  92.    as the face specified by CullFace.  When all of the vertexes
  93.    of a polygon are culled, then the polygon is culled.
  94.  
  95.    The eye direction used for vertex culling is determined
  96.    by the culling eye position.  The culling eye position
  97.    is homogeneous (like a light position).  When the w component
  98.    of the position is non-zero, the position is local and the
  99.    eye direction at each vertex is computed by subtracting
  100.    the vertex position from the eye position.  When the w
  101.    component of the position is zero, the position is non-local
  102.    and the is used as the eye direction for all vertexes.
  103.  
  104.    The culling eye position is specified by the CullParameter
  105.    command.  Positions specified when <pname> is
  106.    CULL_VERTEX_EYE_POSITION_EXT are in eye space and are
  107.    transformed by the inverse of the current MODELVIEW
  108.    transformation.  Positions specified when <pname> is
  109.    CULL_VERTEX_OBJECT_POSITION_EXT are in object space and are
  110.    used directly.
  111.  
  112.    Vertex culling is performed independently of face culling.
  113.    Polygons on the silhouettes of objects may have both front
  114.    and back facing vertexes.  Since polygons are culled only
  115.    when all of their vertexes are culled, face culling may have
  116.    to be used in addition to vertex culling in order to correctly
  117.    cull silhouette polygons.
  118.  
  119. Additions to Chapter 3 of the 1.1 Specification (Rasterization)
  120.  
  121.     None
  122.  
  123. Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
  124. and the Frame Buffer)
  125.  
  126.     None
  127.  
  128. Additions to Chapter 5 of the 1.1 Specification (Special Functions)
  129.  
  130.     None
  131.  
  132. Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
  133.  
  134.     None
  135.  
  136. Additions to the GLX Specification
  137.  
  138.     XXX - Not complete yet!!!
  139.  
  140. GLX Protocol
  141.  
  142.     XXX - Not complete yet!!!
  143.  
  144. Errors
  145.  
  146.     INVALID_ENUM if <pname> parameter to CullParameterfvEXT or
  147.     CullParameterdvEXT is not CULL_VERTEX_EYE_POSITION_EXT, or
  148.     CULL_VERTEX_OBJECT_POSITION_EXT.
  149.  
  150.     INVALID_OPERATION if CullParameterfvEXT or CullParameterdvEXT called
  151.     between execution of Begin and the corresponding execution of End.
  152.  
  153. New State
  154.  
  155.                                 Initial
  156.     Get Value                Get Command    Type    Value        Attrib
  157.     ---------                -----------    ----    -------        ------
  158.  
  159.     CULL_VERTEX_EXT            IsEnabled    B    False        transform/enable
  160.     CULL_VERTEX_OBJECT_POSITION_EXT    GetFloatv    P    (0,0,1,0)    transform
  161.     CULL_VERTEX_EYE_POSITION_EXT    GetFloatv    P    (0,0,1,0)    transform
  162.  
  163. New Implementation Dependent State
  164.  
  165.     None
  166.